<template>
	<view class="container">
		<view class="title margin32 flexCenter">
			<image
				src="@/static/images/mine/answer.png"
				mode=""
			></image>
			疑难问题解答
		</view>
		<view class="list">
			<view
				class="item"
				v-for="item, index in list"
				:key="item.id"
			>
				<view
					class="top flexBetween"
					@tap="touchstart(index)"
				>

					<view
						class=""
						v-html="item.title"
					>

					</view>
					<image
						:class="{'up':item.isShow==true}"
						src="@/static/images/icon/bottom.png"
						mode=""
						id="1"
					></image>
				</view>
				<view
					class="bottom"
					:class="{'hidden':item.isShow==false}"
					v-html="item.content"
				>

				</view>
			</view>
		</view>
	</view>
</template>

<script>
import {
	Other
} from '@/config/API.js'
export default {
	data () {
		return {
			list: []
		};
	},
	mounted () {
		this.init()
	},
	methods: {
		touchstart (index) {
			this.list[index].isShow = !this.list[index].isShow
		},
		init () {
			Other.question().then(res => {
				res.data.forEach(el => {
					el.isShow = false;
				})
				this.list = res.data
			})
		}
	}
}
</script>

<style>
page {
	background-color: #f4f6f8;
}
</style>
<style lang="scss" scoped>
.title {
	font-size: 48rpx;
	font-family: PingFang SC-Regular, PingFang SC;
	font-weight: 400;
	color: #272729;
	margin: 32rpx;
	image {
		width: 54rpx;
		height: 54rpx;
		margin-right: 8rpx;
	}
}
.list {
	padding: 0 32rpx;
	background-color: #fff;
	.item {
		margin: 42rpx 0;
		.top {
			font-size: 32rpx;
			font-family: PingFang SC-Bold, PingFang SC;
			font-weight: bold;
			color: #272729;
			image {
				width: 24rpx;
				height: 12rpx;
			}
			.up {
				transform: rotateX(180deg);
				// transition: all 1s;
			}
		}
		.bottom {
			font-size: 30rpx;
			font-family: PingFang SC-Medium, PingFang SC;
			font-weight: 500;
			color: #333333;
			line-height: 44rpx;
			margin-top: 24rpx;
			// transition: all 1s;
			width: 100%;
			overflow: hidden;
		}
		.hidden {
			height: 0;
			width: 0;
			// transition: all 1s;
		}
	}
}
</style>